#include<stdio.h>
#define MAX 100
float sum_elements(float a[], unsigned length)
{
    int i;
    float result = 0;
    for (i =0;i<=length-1;i++)
    {
        result+=a[i];
    }
    return result;
}
void main()
{
    float a[MAX];
    unsigned number;
    int i;
    printf("Please enter the amount of numbers in your array:\n");
    scanf("%u",&number);
    if(number <0)
    {
        printf("Wrong!\n");
        return;
    }
    if(number == 0)
    {
        printf("the result is:%f\n",sum_elements(a, number));
        return;
    }
    else
    {
        printf("Please enter the elements:(the tail of array should be end by 'e')\n");
        for(i = 0;i<=number-1;i++)
        {
            scanf("%f\n",&a[i]);
        }
        printf("the result is:%f\n",sum_elements(a, number));
        return;
    }
}
